Use ATE
go



IF OBJECT_ID ( 'APackageTest_Insert', 'P' ) IS NOT NULL 
    DROP PROCEDURE APackageTest_Insert;
GO
CREATE PROCEDURE APackageTest_Insert
    @PackageProductSN nvarchar(50),
	@RecordTime datetime, 
	@UserID nvarchar(10)
AS    	
	insert into APackageTest(PackageProductSN,RecordTime,UserID)
	Values(@PackageProductSN,@RecordTime,@UserID);
GO 



IF OBJECT_ID ( 'APackageTest_selectbySN', 'P' ) IS NOT NULL 
    DROP PROCEDURE APackageTest_selectbySN;
GO
CREATE PROCEDURE APackageTest_selectbySN
    @PackageProductSN nvarchar(50)
AS    
    select PackageProductSN,RecordTime,UserID  
    from APackageTest 
    where PackageProductSN=@PackageProductSN 
GO



IF OBJECT_ID ( 'APackageTest_selectbyDT', 'P' ) IS NOT NULL 
    DROP PROCEDURE APackageTest_selectbyDT;
GO
CREATE PROCEDURE APackageTest_selectbyDT
    @starttime datetime,
    @stoptime datetime
AS    
    select PackageProductSN,RecordTime,UserID  
    from APackageTest 
    where RecordTime between @starttime and @stoptime  
    order by RecordTime desc 
GO










